package com.wyd.component.consumer;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * Created with IntelliJ IDEA.
 *
 * @Auther: 雷哥
 * @Date: 2020/10/07/22:24
 * @Description:
 */
@Component
public class WorkConsumer {

  @RabbitListener(queuesToDeclare = {@Queue("work")})
  public void receive1(String body){
    System.out.println("消费者【1】收到消息：内容为:"+body);
  }

  @RabbitListener(queuesToDeclare = {@Queue("work")})
  public void receive2(String body){
    System.out.println("消费者【2】收到消息：内容为:"+body);
  }

}
